package com.zjj.day2.Test6;

import java.util.List;

/**
 * @author zhoujunjie
 * @desc TODO
 * @date 2025/4/20
 */
class User {
    private String name;

    public User(String name) {
        this.name = name;
    }

    public Order placeOrder(String orderId, List<Goods> goodsList) {
        Order order = new Order(orderId);
        for (Goods goods : goodsList) {
            order.addGoods(goods);
        }
        System.out.println(name + " 下了订单，订单号为: " + orderId);
        return order;
    }

    public String getName() {
        return name;
    }
}